import { post, get } from "../utils/request";

/*
订单提交
url
  /api/v1/orders
method
  post
headers
  authorization Bearer token  // 需要提供jwt信息
data
  {
    receiver      收货人
    regions       收货的省市区县
    address       收货地址
    orderDetails
      [{
        quantity  数量
        product   商品id
        price     商品单价
      }]
  }
*/
// 提交订单
export const addOrder = (data) => post("/api/v1/orders", data);
//获取订单
export const Orderlist = () => get("/api/v1/orders");